import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

// about inheritance 
//http://stackoverflow.com/questions/619761/jaxb-inheritance-unmarshal-to-subclass-of-marshaled-class

@XmlRootElement(name="student")
public class Student extends Person{
	
	/* for marshaling purposes */
	@Deprecated
	public Student() {	}
	
	public Student(int id, String name, double avg) {
		super(id, name);
		this.id = id;
		this.name = name;
		this.average = avg;
	}

	@XmlElement(name = "student.id")
    private Integer id;
    
	@XmlElement(name = "student.name")
	private String name;
    
    @XmlElement(name = "student.avreage")
    private Double average;
	
    @Override
    public String toString() {
    	return super.toString() + 
    			"\n\t" + getClass() + "  id=" + id + "  / name=" + name + "  / average=" + average;
    }
}
